From d1b295913fee1b6c7aaaf7ac8a26b085e0c854f0 Mon Sep 17 00:00:00 2001 From: "kfraser@localhost.localdomain" Date: Tue, 7 Aug 2007 09:06:38 +0100 Subject: [PATCH] xentop: fix abnormal value cpu(%) when domain shutdown. If we test multiple domain create/shutdown many times. sometimes abnormal values of cpu(%) are appeared. This is because shutdown domain remove failure. (in other words, memory corruption of struct ) This corruption makes abnormal cpu(%) values are shown xentop sometimes. Signed-off-by: Atsushi SAKAI --- tools/xenstat/libxenstat/src/xenstat.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tools/xenstat/libxenstat/src/xenstat.c b/tools/xenstat/libxenstat/src/xenstat.c index a109960c41..461806ec7d 100644 --- a/tools/xenstat/libxenstat/src/xenstat.c +++ b/tools/xenstat/libxenstat/src/xenstat.c @@ -677,7 +677,7 @@ static void xenstat_prune_domain(xenstat_node *node, unsigned int entry) /* shift entries following specified entry up by one */ if (entry < node->num_domains) { xenstat_domain *domain = &node->domains[entry]; - memmove(domain,domain+1,node->num_domains-entry); + memmove(domain,domain+1,(node->num_domains - entry) * sizeof(xenstat_domain) ); } /* zero out original last entry from node -- not -- 2.30.2